#ifndef AVALON_AUTHENTICATEDSERVERCHANNEL_HPP
#define AVALON_AUTHENTICATEDSERVERCHANNEL_HPP
#include "Avalon/ServiceLocator/DirectoryEntry.hpp"

namespace Avalon {
namespace ServiceLocator {

  /*! \class AuthenticatedServerChannel
      \brief Mixin-class for a Channel that authenticates with the
             ServiceLocator.
   */
  class AuthenticatedServerChannel {
    public:

      //! Constructs an AuthenticatedServerChannel.
      AuthenticatedServerChannel();

      ~AuthenticatedServerChannel();

      //! Returns <code>true</code> iff the Channel is logged in.
      bool IsLoggedIn() const;

      //! Returns the Account.
      const DirectoryEntry::Tag& GetAccount() const;

      //! Sets the Account, establishing it as having logged in.
      /*!
        \param account The Account Tag to associate with this Channel.
      */
      void SetAccount(const DirectoryEntry::Tag& account);

      //! Resets the Account, logging it out.
      void ResetAccount();

    private:
      DirectoryEntry::Tag m_account;
  };
}
}

#endif // AVALON_AUTHENTICATEDSERVERCHANNEL_HPP
